<!DOCTYPE html>
<html lang="zh-CN">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <!-- getElementsByName() //通过元素的 Name 属性的值 -->
  <div name="aa">

  </div>
  <div class="hao" name="aa">

  </div>
</body>
<script>
  let names = document.getElementsByName("aa");
  console.log(names);
</script>

</html>